﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DriverForm.aspx.cs" Inherits="YhmOA.Integrated.Car.DriverForm" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxLoadingPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>司机</title>
    <link type="text/css" rel="Stylesheet" href="../../Styles/Common.css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.5.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/Common.js"></script>
    <script src="../../Scripts/DevEx.js" type="text/javascript"></script>
    <script type="text/javascript">
        function Save(s, e) {
            if (ASPxClientEdit.ValidateEditorsInContainer(null)) {
                cbSaveCtrl.PerformCallback(txt_PicPathCtrl.GetImageUrl().replace(GetLocationHost(), '~/'));
                lpSaveCtrl.Show();
                $(this).wijdialog('close');
            }
        };
        function SaveCallback(s, e) {
            if (s.cpIsSucceed == true) {
                lpSaveCtrl.SetText('提交成功');
                parent.Search();
                window.setTimeout(function () { lpSaveCtrl.Hide(); lpSaveCtrl.SetText('正在提交信息,请稍后...'); }, 1500);
            } else {
                lpSaveCtrl.SetText('提交失败');
                window.setTimeout(function () { lpSaveCtrl.Hide(); lpSaveCtrl.SetText('正在提交信息,请稍后...'); }, 1500);
            }
        };
        //重置文本框
        function ResetEdit(s, e) {
            ASPxClientEdit.ClearEditorsInContainer(null);
            txt_SexFlagCtrl.Focus();
            cbDrivingLicenceTypeCtrl.Focus();
            tbxRecordSNCtrl.Focus();
            lpSaveCtrl.SetText('正在提交信息,请稍后...');
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="MainRound">
        <div class="MainRoundContent">
            <div class="MainRoundContentW">
                <div class="MainBody">
                    <table class="Table">
                        <tr>
                            <td style="width: 120px">
                                档案编号：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_RecordSN" ClientInstanceName="tbxRecordSNCtrl" runat="server"
                                    MaxLength="50" NullText="请输入档案编号" TabIndex="1" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入档案编号"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                驾龄：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_DrivingAge" ClientInstanceName="tbxDrivingAgeCtrl" runat="server"
                                    MaxLength="10" NullText="请输入驾龄" TabIndex="2" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入驾龄"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                姓名：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_Name" ClientInstanceName="tbxNameCtrl" runat="server" MaxLength="50"
                                    NullText="请输入姓名" TabIndex="3" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入姓名"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                性别:
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxComboBox ID="txt_SexFlag" runat="server" Width="200px" TabIndex="4" CssClass="TableNoBorder"
                                    ClientInstanceName="txt_SexFlagCtrl" Spacing="0">
                                    <Items>
                                        <dx:ListEditItem Text="女" Value="女" />
                                        <dx:ListEditItem Text="男" Value="男" />
                                        <dx:ListEditItem Text="不详" Value="不详" />
                                    </Items>
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus" />
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择性别"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请选择性别">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                出生日期：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxDateEdit ID="txt_Birthday" ClientInstanceName="deBirthdayCtrl" runat="server"
                                    TabIndex="5" NullText="请选择出生日期" Width="200px" Spacing="0" PopupVerticalAlign="TopSides">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择出生日期"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxDateEdit>
                            </td>
                            <td style="width: 120px">
                                住址：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_Address" ClientInstanceName="tbxAddressCtrl" runat="server"
                                    MaxLength="250" NullText="请输入住址" TabIndex="6" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入住址"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                电话号码：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_TelNum" ClientInstanceName="tbxTelNumCtrl" runat="server"
                                    MaxLength="20" NullText="请输入电话号码" TabIndex="7" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入电话号码"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                手机：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_PhoneNum" ClientInstanceName="tbxPhoneNumCtrl" runat="server"
                                    MaxLength="20" NullText="请输入手机" TabIndex="8" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入手机"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                准驾证号 ：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_DrivingLicenceNum" ClientInstanceName="tbxDrivingLicenceNumCtrl"
                                    runat="server" MaxLength="50" NullText="请输入准驾证号 " TabIndex="9" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入准驾证号 "
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                准驾类型：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxComboBox ID="txt_DrivingLicenceType" ClientInstanceName="cbDrivingLicenceTypeCtrl"
                                    runat="server" Width="200px" TabIndex="10" CssClass="TableNoBorder" Spacing="0"
                                    ClientIDMode="AutoID" ValueType="System.String">
                                    <Items>
                                        <dx:ListEditItem Text="A" Value="A" />
                                        <dx:ListEditItem Text="B" Value="B" />
                                        <dx:ListEditItem Text="C" Value="C" />
                                    </Items>
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus" />
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择准驾类型"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请选择准驾类型">
                                        <RequiredField IsRequired="True" />
                                        <ErrorFrameStyle CssClass="TableNoBorder">
                                        </ErrorFrameStyle>
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                领证日期：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxDateEdit ID="txt_LicenceDate" ClientInstanceName="deLicenceDateCtrl" runat="server"
                                    TabIndex="11" NullText="请选择领证日期" Width="201px" Spacing="0" PopupVerticalAlign="TopSides">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择领证日期"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxDateEdit>
                            </td>
                            <td style="width: 120px">
                                生效日期：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxDateEdit ID="txt_LicenceBeginDate" ClientInstanceName="deLicenceBeginDateCtrl"
                                    runat="server" TabIndex="12" NullText="请选择生效日期" Width="200px" Spacing="0" PopupVerticalAlign="TopSides">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择生效日期"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxDateEdit>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                失效日期：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxDateEdit ID="txt_LicenceEndDate" ClientInstanceName="deLicenceEndDateCtrl"
                                    runat="server" TabIndex="13" NullText="请选择失效日期" Width="200px" Spacing="0" PopupVerticalAlign="TopSides">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择失效日期"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxDateEdit>
                            </td>
                            <td style="width: 120px">
                                部门：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_DepartMent" ClientInstanceName="tbxDepartMentCtrl" runat="server"
                                    MaxLength="50" NullText="请输入部门" TabIndex="14" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入部门"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                备注：
                            </td>
                            <td style="width: 620px" colspan="3">
                                <dx:ASPxMemo ID="txt_Remarks" runat="server" MaxLength="250" NullText="请输入备注" Height="50px"
                                    ClientInstanceName="txt_RemarksCtrl" TabIndex="15" Width="580px">
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxMemo>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                图片：
                            </td>
                            <td style="width: 620px" colspan="3" class="TableNoBorder">
                                <dx:ASPxUploadControl ID="uplPicPath" runat="server" Width="580px" TabIndex="16"
                                    ShowUploadButton="true" OnFileUploadComplete="uplPicPath_FileUploadComplete"
                                    AddUploadButtonsSpacing="0px">
                                    <ClientSideEvents FileUploadComplete="function(s, e) {cbPicPathCtrl.PerformCallback(e.callbackData);lpPicPathCtrl.Show();}">
                                    </ClientSideEvents>
                                    <UploadButton Text="上传">
                                    </UploadButton>
                                </dx:ASPxUploadControl>
                                <div id="imgPicDiv">
                                    <dx:ASPxImage ID="txt_PicPath" runat="server" Height="62px" Width="100px" ClientInstanceName="txt_PicPathCtrl">
                                        <EmptyImage Url="~/Images/img_error.jpg">
                                        </EmptyImage>
                                    </dx:ASPxImage>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <table class="TableNoBorder" style="width: 740px">
                        <tr>
                            <td colspan="2" />
                            <td align="left" style="margin-right: 20px; width: 100px">
                                <dx:ASPxButton ID="btnSave" runat="server" Text="保  存" Width="80px" AutoPostBack="false"
                                    TabIndex="17">
                                    <ClientSideEvents Click="Save" />
                                </dx:ASPxButton>
                            </td>
                            <td align="left" style="margin-right: 20px; width: 100px">
                                <dx:ASPxButton ID="btnCancel" runat="server" Text="重  置" Width="80px" TabIndex="18" AutoPostBack="false">
                                    <ClientSideEvents Click="ResetEdit" />
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <dx:ASPxCallback ID="cbPicPath" runat="server" ClientInstanceName="cbPicPathCtrl"
                        OnCallback="cbPicPath_Callback">
                        <ClientSideEvents CallbackComplete="function(s, e) {
                                txt_PicPathCtrl.SetImageUrl(GetLocationHost()+s.cpImgPicUrl);
                                lpPicPathCtrl.Hide();
                            }" />
                    </dx:ASPxCallback>
                    <dx:ASPxLoadingPanel ID="lpPicPath" runat="server" Text="正在上传图片.." ClientInstanceName="lpPicPathCtrl"
                        ContainerElementID="imgPicDiv">
                    </dx:ASPxLoadingPanel>
                    <dx:ASPxCallback ID="cbSave" runat="server" ClientInstanceName="cbSaveCtrl" OnCallback="cbSave_Callback">
                        <ClientSideEvents CallbackComplete="SaveCallback" />
                    </dx:ASPxCallback>
                    <dx:ASPxLoadingPanel ID="lpSave" runat="server" Text="正在提交信息,请稍后..." ClientInstanceName="lpSaveCtrl">
                    </dx:ASPxLoadingPanel>
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
